package tianrun.ziguan.api.calculate.config.utils;

import io.lettuce.core.output.KeyStreamingChannel;

public class Setter<V> {

    private final KeyStreamingChannel<V> channel;

    private final V v;

    public Setter(KeyStreamingChannel<V> channel, V v) {
        this.channel = channel;
        this.v = v;
    }
    public static <N> Setter<N> set(KeyStreamingChannel<N> channel, N v) {
        return new Setter<>(channel, v);
    }

    public void onOk() {
        channel.onKey(v);
    }
}
